package org.keyroy.map_editor.core;

import java.util.ArrayList;
import java.util.List;

public class Map {
	protected List<MapListener> listeners = new ArrayList<MapListener>();
	protected List<MapOverLay> mapLayers = new ArrayList<MapOverLay>();

	protected int columns, rows;
	protected int gridWidth, gridHeight;

	public Map(int columns, int rows, int gridWidth, int gridHeight) {
		this.columns = columns;
		this.rows = rows;
		this.gridWidth = gridWidth;
		this.gridHeight = gridHeight;
	}

	public final int getColumns() {
		return columns;
	}

	public final int getRows() {
		return rows;
	}

	public final int getGridWidth() {
		return gridWidth;
	}

	public final int getGridHeight() {
		return gridHeight;
	}

	public final void addListener(MapListener mapListener) {
		listeners.add(mapListener);
	}

	public final void callMapChange() {
		for (int i = 0; i < listeners.size(); i++) {
			listeners.get(i).onMapChange();
		}
	}
}
